package net.borlis.errors.providers.implementation.enumbase;

/**
 * @author alex@borlis.net
 */
@Deprecated
public enum LangDE {

    e100("wrong_user_id", "(de) wrong_user_id"),
    e150("user_id_is_not_set", "(de) user_id_is_not_set"),
    e200("vito_does_not_exist", "(de) vito_does_not_exist"),
    e250("vito_id_is_not_set", "(de) vito_id_is_not_set"),
    e300("quartz_error", "(de) quartz_error"),
    e401("service_key_error", "(de) service_key_error"),
    e402("access_denied", "(de) access_denied"),
    e500("unknown_error", "(de) unknown_error"),
    e601("bank_account_cannot_be_deleted", "(de) bank_account_cannot_be_deleted"),
    e602("bank_account_cannot_be_updated", "(de) bank_account_cannot_be_updated"),
    e603("bank_account_cannot_be_created", "(de) bank_account_cannot_be_created"),
    e604("bank_account_cannot_be_returned", "(de) bank_account_cannot_be_returned"),
    e605("bank_account_list_cannot_be_returned", "(de) bank_account_list_cannot_be_returned"),
    e611("credit_card_cannot_be_deleted", "(de) credit_card_cannot_be_deleted"),
    e612("credit_card_cannot_be_updated", "(de) credit_card_cannot_be_updated"),
    e613("credit_card_cannot_be_created", "(de) credit_card_cannot_be_created"),
    e614("credit_card_cannot_be_returned", "(de) credit_card_cannot_be_returned"),
    e615("credit_card_list_cannot_be_returned", "(de) credit_card_list_cannot_be_returned"),
    e621("booking_config_cannot_be_returned", "(de) booking_config_cannot_be_returned"),
    e622("booking_config_cannot_be_updated", "(de) booking_config_cannot_be_updated"),
    e631("countries_list_cannot_be_returned", "(de) countries_list_cannot_be_returned"),
    e632("locales_list_cannot_be_returned", "(de) locales_list_cannot_be_returned"),
    e633("credit_card_types_list_cannot_be_returned", "(de) credit_card_types_list_cannot_be_returned"),
    e634("booking_strategies_list_cannot_be_returned", "(de) booking_strategies_list_cannot_be_returned"),
    e635("hierarchy_levels_list_cannot_be_returned", "(de) hierarchy_levels_list_cannot_be_returned"),
    e641("travel_period_cannot_be_deleted", "(de) travel_period_cannot_be_deleted"),
    e642("last_travel_period_cannot_be_deleted", "(de) last_travel_period_cannot_be_deleted"),
    e643("travel_period_cannot_be_returned", "(de) travel_period_cannot_be_returned"),
    e644("travel_period_cannot_be_updated", "(de) travel_period_cannot_be_updated"),
    e645("travel_period_cannot_be_created", "(de) travel_period_cannot_be_created"),
    e646("travel_periods_list_cannot_be_returned", "(de) travel_periods_list_cannot_be_returned"),
    e651("vito_address_cannot_be_deleted", "(de) vito_address_cannot_be_deleted"),
    e652("vito_address_cannot_be_updated", "(de) vito_address_cannot_be_updated"),
    e653("vito_address_cannot_be_created", "(de) vito_address_cannot_be_created"),
    e654("vito_address_cannot_be_returned", "(de) vito_address_cannot_be_returned"),
    e655("vito_addresses_list_cannot_be_returned", "(de) vito_addresses_list_cannot_be_returned"),
    e661("vito_filter_cannot_be_returned", "(de) vito_filter_cannot_be_returned"),
    e662("vito_cannot_be_configured", "(de) vito_cannot_be_configured"),
    e663("vito_cannot_be_created", "(de) vito_cannot_be_created"),
    e664("vito_active_providers_list_cannot_be_returned", "(de) vito_active_providers_list_cannot_be_returned"),
    e665("vito_providers_list_cannot_be_returned", "(de) vito_providers_list_cannot_be_returned"),
    e666("providers_list_cannot_be_returned", "(de) providers_list_cannot_be_returned"),
    e667("vitos_list_cannot_be_returned", "(de) vitos_list_cannot_be_returned"),
    e668("vito_cannot_be_returned", "(de) vito_cannot_be_returned"),
    e671("provider_booking_info_list_cannot_be_returned", "(de) provider_booking_info_list_cannot_be_returned"),
    e672("provider_booking_info_cannot_be_updated", "(de) provider_booking_info_cannot_be_updated"),
    e681("portfolio_settings_cannot_be_returned", "(de) portfolio_settings_cannot_be_returned"),
    e682("portfolio_setting_cannot_be_updated", "(de) portfolio_setting_cannot_be_updated"),
    e700("illegal_to_state_in_revert_lifecycle_configuration", "(de) illegal_to_state_in_revert_lifecycle_configuration"),
    e710("unknown_lifecycle_state", "(de) unknown_lifecycle_state"),
    e750("lifecycle_state_not_provided", "(de) lifecycle_state_not_provided"),
    e800("state_machine_exception", "(de) state_machine_exception"),
    e900("margin_validation_error", "(de) margin_validation_error");

    private String key;
    private String message;

    private LangDE(String key, String message) {
        this.key = key;
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

    public String getKey() {
        return key;
    }

    public static String findMessageByKey(String key) {
        for (LangDE ck : LangDE.values()) {
            if (key.equals(ck.getKey())) {
                return ck.getMessage();
            }
        }
        throw new IllegalArgumentException("there is no " + key + " element");
    }

}

